from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import JsonResponse


class LoginRequiredJSONMixin(LoginRequiredMixin):

    def dispatch(self, request, *args, **kwargs):

        return JsonResponse({"code": 400, "errmsg": "未登录"})
